/*
 * Filename:    HcpmsKpiJobParamDTO.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-12-17
 */
package com.paic.mhis.hcpms.quota.calculationreport.calculationjob.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.paic.mhis.hcpms.common.base.dto.BaseDTO;
import com.paic.mhis.hcpms.quota.calculationreport.calculationjob.constants.CalculationJobConstants;

public class HcpmsKpiJobParamDTO extends BaseDTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 17897798798789797L;
	private String regionCode;
	private String period;
	private String userId;
	private String month;
	private String batchNo;
	private String status;
	private Date startDate;
	private Date endDate;
	private List<String> areaCode = new ArrayList<String>();

	public HcpmsKpiJobParamDTO(String month, String period) {
		this.month = month;
		this.period = period;
		if (CalculationJobConstants.KPI_PERIOD_MONTH.equals(period) && !"".equals(month)) {
			SimpleDateFormat sft = new SimpleDateFormat("yyyy-MM-dd");
			try {
				this.startDate = sft.parse(month + "-01");
				Calendar cal = Calendar.getInstance();
				cal.setTime(startDate);
				cal.add(Calendar.MONTH, 1);
				cal.add(Calendar.MILLISECOND, -1);
				this.endDate = cal.getTime();
			} catch (ParseException e) {
				e.printStackTrace();
			}
		}
	}

	public HcpmsKpiJobParamDTO() {

	}

	public String getRegionCode() {
		return regionCode;
	}

	public void setRegionCode(String regionCode) {
		this.regionCode = regionCode;
	}

	public String getPeriod() {
		return period;
	}

	public void setPeriod(String period) {
		this.period = period;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getMonth() {
		return month;
	}

	public void setMonth(String month) {
		this.month = month;
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public List<String> getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(List<String> areaCode) {
		this.areaCode = areaCode;
	}

}
